package cn.dada.dadarecipes.base.interceptor;

import cn.dada.dadarecipes.base.util.LoginValidation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedReader;
import java.util.Map;

@Slf4j
public class MerchantLoginCheckInterceptor implements HandlerInterceptor {

    /**
     * 商家登陆校验拦截器
     * @param request
     * @param response
     * @param handler
     * @return
     * @throws Exception
     */
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        LoginValidation.isMerchantLogin(request.getSession());
        return true;
    }
}
